/* eslint-disable import/no-anonymous-default-export */
import React, { FC } from 'react'
import { NavBar, TabBar } from 'antd-mobile'
import {
    Route,
    Switch,
    HashRouter as Router,
    useHistory,
} from 'react-router-dom'

import Bottom from './components/home/bottom'
import Home from './pages/Home'
import All from './pages/All'
import News from './pages/News'
import Mine from './pages/Mine'
import NewsDetail from './components/cc-news/NewsDetail'
import Personal from './pages/Personal'
import Alter from './components/xz-mine/Alter'

import Education from './components/wsl-all/other/Education'
import Park from './components/wsl-all/other/Park'
import Parkj1 from './components/wsl-all/other/Parkjl'
import Gov from './components/wsl-all/other/Gov'
import Hospital from './components/wsl-all/other/Hospital'
import HospitalDetail from './components/wsl-all/other/HospitalDetail'
import HospitalCard from './components/wsl-all/other/HospitalCard'
import newHCard from './components/wsl-all/other/newHCard'
import newHCard1 from './components/wsl-all/other/newHCard1'
import Parkjl from './components/wsl-all/other/Parkjl'
import ParkDetails from './components/wsl-all/other/ParkDetails'
import ParkCar from './components/wsl-all/other/ParkCar'
// import Waste from './components/wsl-all/Waste'
import ParkPay from './components/wsl-all/other/ParkPay'
import MetroPage from './components/wsl-all/other/metro/MetroPage'
import MetroMap from './components/wsl-all/other/metro/MetroMap'
import MetroDetail from './components/wsl-all/other/metro/MetroDetail'
import MetroRoad from './components/wsl-all/other/metro/MetroRoad'
import PackFeedBack from './components/wsl-all/other/ParkFeedBack'

import Reg from './components/xz-mine/pages/Reg'
import ChangePass from './components/xz-mine/pages/ChangePass'
import OrderForm from './components/xz-mine/pages/OrderForm'
import FeedBack from './components/xz-mine/pages/FeedBack'
import FeedBackList from './components/xz-mine/pages/FeedBackList'
import Details from './components/xz-mine/pages/Details'
import LibraryList from './components/cc-library/LibraryList'
import LibraryDetail from './components/cc-library/LibraryDetail'
import LibraryComment from './components/cc-library/LibraryComment'
import Voluntee from './components/cc-voluntee/Voluntee'
import VolunteerDetail from './components/cc-voluntee/VolunteerDetail'
import ParkFeedBackDetails from './components/wsl-all/other/ParkFeedBackDetails'
import ParkNews from './components/wsl-all/other/ParkNews'
import CustomShuttle from './components/xz-mine/bus/CustomShuttle'
import LineService from './components/xz-mine/bus/LineService'
import StopQuery from './components/xz-mine/bus/StopQuery'
import VolunteeActivityDetail from './components/cc-voluntee/VolunteeActivityDetail'

export default () => {
    const back = () => {
        window.history?.go(-1)
    }

    return (
        <Router>
            <div className="app">
                <div className="top">
                    <NavBar onBack={back}>智慧城市</NavBar>
                </div>
                <div className="body">
                    <Switch>
                        <Route exact path='/'>
                            <Home />
                        </Route>
                        <Route exact path='/all'>
                            <All />
                        </Route>
                        <Route exact path='/news'>
                            <News />
                        </Route>
                        <Route exact path='/mine'>
                            <Mine />
                        </Route>
                        <Route path="/education/index" component={Education}></Route>
                        <Route path="/Park/index" component={Park}></Route>
                        <Route path="/Park/parkjl" component={Parkjl}></Route>

                        <Route path="/Park/index" component={Park}></Route>
                        <Route path="/Park/parkjl" component={Parkj1}></Route>
                        <Route path="/Park/index" component={Park}></Route>
                        <Route path="/Park/parkjl" component={Parkjl}></Route>
                        <Route path='/Park/ParkDetails/:id' component={ParkDetails}></Route>
                        <Route path="/Park/index" component={Park}></Route>
                        <Route path='/Park/ParkCar' component={ParkCar}></Route>
                        <Route path='/Park/ParkPay' component={ParkPay}></Route>
                        <Route path='/Park/ParkFeedBack' component={PackFeedBack}></Route>
                        <Route path='/Park/ParkFeedBackDetails/:id' component={ParkFeedBackDetails}></Route>
                        <Route path='/Park/ParkNews' component={ParkNews}></Route>
                        {/* <Route path='/classification/index' component={Waste}></Route> */}
                        <Route exact path='/newsdetail/:id'>
                            <NewsDetail />
                        </Route>
                        <Route path='/mine/personal' component={Personal}></Route>
                        <Route path='/mine/alter' component={Alter}></Route>

                        <Route path='/hotline/index' component={Gov}></Route>
                        <Route path='/outpatient/hospitalList' component={Hospital} exact></Route>
                        <Route path='/outpatient/hospitalList/detail/:id' component={HospitalDetail} exact></Route>
                        <Route path='/outpatient/hospitalList/detail/:id/card' component={HospitalCard} exact></Route>
                        <Route path='/outpatient/hospitalList/detail/:id/card/add' component={newHCard} exact></Route>
                        <Route path='/outpatient/hospitalList/detail/:id/card/add/:man' component={newHCard1} ></Route>
                        <Route path='/metro_query/index' component={MetroPage} exact></Route>
                        <Route path='/metro_query/index/map' component={MetroMap}></Route>
                        <Route path='/metro_query/index/detail/:id' component={MetroDetail}></Route>
                        <Route path='/metro_query/index/road/:road' component={MetroRoad}></Route>
                        <Route path='/mine/reg' component={Reg}></Route>
                        <Route path='/mine/changepass' component={ChangePass}></Route>
                        <Route path='/mine/orderform' component={OrderForm}></Route>
                        <Route path='/mine/feedback' component={FeedBack}></Route>
                        <Route path='/mine/feedbacklist' component={FeedBackList}></Route>
                        <Route path='/mine/details/:id' component={Details}></Route>
                        <Route path="/Park/index" component={Park}></Route>
                        <Route path="/Park/parkjl" component={Parkjl}></Route>
                        <Route path="/Park/index" component={Park}></Route>
                        <Route exact path='/news/detail/:id' component={NewsDetail}></Route>
                        <Route path='/mine/personal' component={Personal}></Route>
                        <Route path='/mine/alter' component={Alter}></Route>
                        <Route path='/library/index' component={LibraryList}></Route>
                        <Route path='/library/detail/:id' component={LibraryDetail}></Route>
                        <Route path='/library/comment/:id' component={LibraryComment}></Route>
                        <Route path='/voluntee/index' component={Voluntee}></Route>
                        <Route path='/voluntee/detail' component={VolunteerDetail}></Route>
                        <Route path='/bus_query/custom_shuttle' component={CustomShuttle}></Route>
                        <Route path='/bus_query/line_service/:id' component={LineService}></Route>
                        <Route path='/bus_query/stop_query' component={StopQuery}></Route>
                        <Route path='/voluntee/detail/:id' component={VolunteerDetail}></Route>
                        <Route path='/voluntee/activity/detail/:id' component={VolunteeActivityDetail}></Route>
                    </Switch>
                </div>
                <div className="bottom">
                    <Bottom />
                </div>
            </div>
        </Router>
    )
}